package icu.groot.alan.dao;

import icu.groot.alan.entity.Department;
import icu.groot.alan.entity.LoginUser;
import icu.groot.alan.entity.OneselfUser;
import icu.groot.alan.entity.Paging;

import java.sql.Connection;
import java.sql.SQLException;
import java.util.List;

public interface UserDao {
    LoginUser login(int code, Connection connection);

    OneselfUser oneself(int code, Connection connection);

    List<String> getDepartmentByCode(Connection connection, int code);

    int updateDepartmentByDepId(Connection connection, int[] idsInt);

    int getCount(Connection connection, String fuzzyQuery, int departmentId);

    void paging(Paging<OneselfUser> paging, Connection connection);

    int add(String name, String gender, String birthDate, String jobTitle, String education, String degree, String qq, String email, String introduction, String departmentId, String password, Connection connection) throws SQLException;

    OneselfUser getUserByCode(Connection connection, int code) throws SQLException;

    int deleted(Connection connection, int[] codes) throws SQLException;

    int updateUserByCode(Connection connection, int code, String name, String gender, String birthDate, String jobTitle, String education, String degree, String qq, String email, String introduction, String departmentId, String password) throws SQLException;
}
